package xuesm.prototype.shallow.custom;

import java.util.List;

/**
 * @Author: xuesm
 * @Description: 自己实现clone
 * @Date: Create in 13:06 2019/4/1
 */
public class UserCustomShallowProyotype implements IPrototype{

	private int age;
	private String name;
	private List<String> hobbies;

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<String> getHobbies() {
		return hobbies;
	}

	public void setHobbies(List<String> hobbies) {
		this.hobbies = hobbies;
	}

	@Override
	public IPrototype clone() {
		UserCustomShallowProyotype proyotype = new UserCustomShallowProyotype();
		proyotype.setAge(this.age);
		proyotype.setName(this.name);
		proyotype.setHobbies(this.hobbies);
		return proyotype;
	}
}
